#ifndef __TASKQUEUE_H__
#define __TASKQUEUE_H__
#include "MutexLock.hpp"
#include "Condition.hpp"
#include <queue>
#include <functional>
using std::queue;

using ElemType = std::function<void()>;
namespace wd{

class TaskQueue{

public:
    TaskQueue(int);
    void push(ElemType);
    ElemType pop();
    bool full();
    bool empty();
    void wakeup();

private:
    queue<ElemType> _que;
    int             _queSize;
    MutexLock       _mutex;
    Condition       _notFull;
    Condition       _notEmpty;
    bool            _flag;

};


}
#endif

